package com.t20;

import java.util.List;

/**
 * Created by xuyiwei on 2018/9/13.
 */
public class PasswordUtils {
    @UseCase(id=47,description = "Passwords must contain at least on numeric")
    public boolean validatePassword(String password){
        return password.matches("\\w*\\d\\w*");
    }
    @UseCase(id=48)
    public String encryptPassword(String password){
        return new StringBuilder(password).reverse().toString();
    }
    @UseCase(id=49,description = "New passwords can not equal previously used ones")
    public boolean checkForNewPassword(List<String> prePasswords, String password){
        return !prePasswords.contains(password);
    }

    @SimulatingNull()
    public boolean checkForNewPassword1(List<String> prePasswords, String password){
        return !prePasswords.contains(password);
    }
}
